
// 水平布局类
console.log(uilayout)
class hLayout extends egret.Sprite {
    private myGroup: eui.Group;
    public constructor() {
        super();
        this.myGroup = new eui.Group();
        this.addChild(this.myGroup);
        this.myGroup.layout = new eui.BasicLayout()
        this.myGroup.width = 500;
        this.myGroup.height = 200;
        let outline: egret.Shape = new egret.Shape();
        outline.graphics.lineStyle(3, 0x00ff00);
        outline.graphics.beginFill(0x000000, 0);
        outline.graphics.drawRect(0, 0, 500, 300);
        outline.graphics.endFill();
        this.myGroup.addChild(outline);
        // let btn1:eui.Button = new eui.Button();
        // btn1.label = 'Button A';
        // let btn2:eui.Button = new eui.Button();
        // btn2.label = 'Button B';
        // let btn3:eui.Button = new eui.Button();
        // btn3.label = 'Button C';
        // this.myGroup.addChild(btn1);
        // this.myGroup.addChild(btn2);
        // this.myGroup.addChild(btn3);
        this.myGroup.horizontalCenter = 0;
        this.myGroup.layout = new uilayout.RingLayout();//自定义布局
        this.addChild(this.myGroup);
        //内部对象
        for (var i: number = 0; i < 20; i++) {
            var btn: eui.Button = new eui.Button();
            btn.width = 40;
            btn.height = 40;
            btn.label = "Button" + i;
            this.myGroup.addChild(btn);
        }
        // var hLayout: eui.HorizontalLayout = new eui.HorizontalLayout();
        // hLayout.gap = 40;
        // hLayout.paddingTop = 0;
        // hLayout.paddingLeft = 50;
        // hLayout.horizontalAlign = egret.HorizontalAlign.CENTER;
        // this.myGroup.layout = hLayout;   /// 水平布局
    }

}